<template>
    <div class="page admin-wrapper">
        <my-input v-model="value" label="tag" class="admin-tag" />
        <mavon-editor ref=md :ishljs="true" v-model="contentVal" @imgAdd="handleAddImg" @imgDel="handleDelImg" class="value-wrapper" />
        <my-button text="发送" @click.native="submit" size="mini"/>
    </div>
</template>

<script>
    import MyButton from '../components/myButton'
    import MyInput from '../components/myInput'
    export default {
        name: 'admin',
        components: {
          MyButton,
            MyInput
        },
        data() {
            return {
                contentVal: '',
                value: ''
            }
        },
        methods: {
            handleAddImg() {

            },
            handleDelImg() {

            },
            async submit() {
                let res = await this.$request.post('/api/soundCode', {code: this.contentVal, codeTag: this.value})
                window.console.log(res)
            }
        }
    }
</script>

<style scoped>
    .admin-wrapper {
        padding-top: .2rem
    }
    .admin-wrapper .admin-tag {
        margin-bottom: .2rem;
    }
    .admin-wrapper .value-wrapper {
        height: 6rem;
    }
</style>
